#ifndef HSE_POSTING
#define HSE_POSTING
#include <string>
#include <vector>
#include <map>
#include "hse_common.h"

namespace hse {

using std::string;
using std::vector;

struct DocWord {
	string word;
	int length;
	int position;

	DocWord(const char* _word, int _length, int _position)
		: word(_word), length(_length), position(_position) {
	}
};

struct DocPositions {
	int doc_id;
	int count;
	vector<int> positions;
};

struct Posting {
	string term; 
	vector<DocPositions*> doc_positions;
};

typedef std::map<string, Posting*, StringLess> InvertedList;

struct DocumentMetaData {
	int doc_id;
	string name;
	int word_count;
	int length;
	string full_name;
	unsigned char type;
	double k;
	DocumentMetaData() 
		: k(0), length(0), word_count(0), type(0)
	{}
};

struct SearchResult {
	string doc_name;
	string segment;
	int doc_id;
};

}
#endif